//
//  NetworkTools.swift
//  XMGWB
//
//  Created by 1 on 16/1/11.
//  Copyright © 2016年 xiaomage. All rights reserved.
//

import UIKit
import AFNetworking

class NetworkTools: AFHTTPSessionManager {

    static let shareInstance: NetworkTools = {
        // 注意: 指定baseURL一定要以/结尾
       let url = NSURL(string: "https://api.weibo.com/")
       let tools =  NetworkTools(baseURL: url)
        //序列化少了类型,需要添加text/plain这种类型
        tools.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as? Set<String>
       return tools
    }()
}
